package MysqlUtils

type UserData struct {
	USER_ID           string `db:"USER_ID         "`
	USER_LOGIN        string `db:"USER_LOGIN      "`
	USER_NAME         string `db:"USER_NAME       "`
	USER_STATUS       int    `db:"USER_STATUS     "`
	USER_SEX          int    `db:"USER_SEX        "`
	USER_PWD          string `db:"USER_PWD        "`
	USER_PWD_TYPE     int    `db:"USER_PWD_TYPE   "`
	USER_IS_SUPER     int    `db:"USER_IS_SUPER   "`
	USER_IS_SYSTEM    int    `db:"USER_IS_SYSTEM  "`
	USER_BIRTHDAY     string `db:"USER_BIRTHDAY   "`
	USER_MOBILE       string `db:"USER_MOBILE     "`
	USER_OFFICE_PHONE string `db:"USER_OFFICE_PHON"`
	USER_QQ           string `db:"USER_QQ         "`
	USER_SHORT_NUMBER string `db:"USER_SHORT_NUMBE"`
	USER_ROOM_NUMBER  string `db:"USER_ROOM_NUMBER"`
	USER_EMAIL        string `db:"USER_EMAIL      "`
	USER_JOB          string `db:"USER_JOB        "`
	USER_JOB_NUMBER   string `db:"USER_JOB_NUMBER "`
	USER_FIRST_SPELL  string `db:"USER_FIRST_SPELL"`
	USER_FULL_SPELL   string `db:"USER_FULL_SPELL "`
	USER_POSITION_ID  string `db:"USER_POSITION_ID"`
	USER_ORDER_ID     int    `db:"USER_ORDER_ID   "`
	USER_CREATE_ID    string `db:"USER_CREATE_ID  "`
	USER_CREATE_NAME  string `db:"USER_CREATE_NAME"`
	USER_CREATE_DATE  int64  `db:"USER_CREATE_DATE"`
	USER_MODIFY_DATE  int64  `db:"USER_MODIFY_DATE"`
	USER_MODIFY_ID    string `db:"USER_MODIFY_ID  "`
	USER_MODIFY_NAME  string `db:"USER_MODIFY_NAME"`
	USER_DOMAINID     string `db:"USER_DOMAINID   "`
	USER_LOGINADDR    string `db:"USER_LOGINADDR  "`
	USER_LOGINMAC     string `db:"USER_LOGINMAC   "`
	USER_NOTE         string `db:"USER_NOTE       "`
	USER_PICTURE      string `db:"USER_PICTURE    "`
	USER_ADDRESS      string `db:"USER_ADDRESS    "`
}

type DeptData struct {
	DEPT_ROOT_ID          string `db:"DEPT_ROOT_ID"`
	DEPT_ID               string `db:"DEPT_ID"`
	DEPT_NAME             string `db:"DEPT_NAME"`
	DEPT_DESC             string `db:"DEPT_DESC"`
	DEPT_CODE             string `db:"DEPT_CODE"`
	DEPT_STYLE            int    `db:"DEPT_STYLE"`
	DEPT_ORDER_ID         int    `db:"DEPT_ORDER_ID"`
	DEPT_PARENT_ID        string `db:"DEPT_PARENT_ID"`
	DEPT_FILE_SERVER      string `db:"DEPT_FILE_SERVER"`
	DEPT_CREATE_ID        string `db:"DEPT_CREATE_ID"`
	DEPT_CREATE_NAME      string `db:"DEPT_CREATE_NAME"`
	DEPT_CREATE_DATE      int64  `db:"DEPT_CREATE_DATE"`
	DEPT_MODIFY_ID        string `db:"DEPT_MODIFY_ID"`
	DEPT_MODIFY_NAME      string `db:"DEPT_MODIFY_NAME"`
	DEPT_MODIFY_DATE      int64  `db:"DEPT_MODIFY_DATE"`
	DEPT_STATUS           int    `db:"DEPT_STATUS"`
	SYNC_ID               string `db:"SYNC_ID"`
	DEPT_INDEPENDENT      int    `db:"DEPT_INDEPENDENT"`
	PARENT_INDEPENDENT_ID string `db:"PARENT_INDEPENDENT_ID"`
}

type UserTreeData struct {
	TREE_ID       string `db:"TREE_ID"`
	DEPT_ID       string `db:"DEPT_ID"`
	DEPT_CODE     string `db:"DEPT_CODE"`
	USER_ID       string `db:"USER_ID"`
	USER_NAME     string `db:"USER_NAME"`
	POSITION_ID   string `db:"POSITION_ID"`
	USER_ORDER_ID int    `db:"USER_ORDER_ID"`
}

const (
	CreateUser = "CREATE TABLE `hs_user` " +
		"( `USER_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '用户GUID' ," +
		"`USER_LOGIN` varchar(50) NOT NULL DEFAULT '' COMMENT '用户登录名'," +
		"`USER_NAME` varchar(50) NOT NULL DEFAULT '' COMMENT '用户名称'," +
		"`USER_STATUS` int(2) DEFAULT 0 COMMENT '用户状态：0:未激活 1:正常（激活） 2:禁用 3:删除'," +
		"`USER_SEX` int(2) DEFAULT 0 COMMENT '性别 1:男 2:女'," +
		"`USER_PWD` varchar(80) NOT NULL DEFAULT '' COMMENT '密码'," +
		"`USER_PWD_TYPE` int(11) NOT NULL DEFAULT 0 COMMENT '密码类型 0:明码 1:MD5'," +
		"`USER_IS_SUPER` int(2) DEFAULT 0 COMMENT '是否超级管理员 0:否 1:是'," +
		"`USER_IS_SYSTEM` int(2) DEFAULT 0 COMMENT '是否系统账号 0:否 1:是'," +
		"`USER_BIRTHDAY` varchar(20) DEFAULT '0' COMMENT '生日，微秒级'," +
		"`USER_MOBILE` varchar(50) DEFAULT '' COMMENT '手机'," +
		"`USER_OFFICE_PHONE` varchar(50) DEFAULT '' COMMENT '单位电话'," +
		"`USER_QQ` varchar(15) DEFAULT '' COMMENT 'QQ'," +
		"`USER_SHORT_NUMBER` varchar(50) DEFAULT '' COMMENT '短号'," +
		"`USER_ROOM_NUMBER` varchar(50) DEFAULT '' COMMENT '房间号'," +
		"`USER_EMAIL` varchar(50) DEFAULT '' COMMENT '邮箱'," +
		"`USER_JOB` varchar(50) DEFAULT '' COMMENT '职务'," +
		"`USER_JOB_NUMBER` varchar(50) DEFAULT '' COMMENT '工号'," +
		"`USER_FIRST_SPELL` varchar(30) DEFAULT '' COMMENT '简拼'," +
		"`USER_FULL_SPELL` varchar(80) DEFAULT '' COMMENT '全拼'," +
		"`USER_POSITION_ID` varchar(50) DEFAULT '' COMMENT '职位id'," +
		"`USER_ORDER_ID` int(11) DEFAULT 10000 COMMENT '排序号'," +
		"`USER_CREATE_ID` varchar(50) DEFAULT '' COMMENT '创建者id'," +
		"`USER_CREATE_NAME` varchar(50) DEFAULT '' COMMENT '创建者用户名'," +
		"`USER_CREATE_DATE` bigint(20) DEFAULT 0 COMMENT '创建时间，微妙级'," +
		"`USER_MODIFY_DATE` bigint(20) DEFAULT 0 COMMENT '最后修改时间，微妙级'," +
		"`USER_MODIFY_ID` varchar(50) DEFAULT '' COMMENT '修改者id'," +
		"`USER_MODIFY_NAME` varchar(50) DEFAULT '' COMMENT '修改者用户名'," +
		"`USER_DOMAINID` varchar(50) DEFAULT '' COMMENT '域id'," +
		"`USER_LOGINADDR` varchar(255) DEFAULT '' COMMENT '用户允许登录的IP地址'," +
		"`USER_LOGINMAC` varchar(255) DEFAULT '' COMMENT '用户允许登录的MAC地址'," +
		"`USER_NOTE` varchar(255) DEFAULT '' COMMENT '签名'," +
		"`USER_PICTURE` varchar(255) NOT NULL DEFAULT '' COMMENT '头像'," +
		"`USER_ADDRESS` varchar(50) DEFAULT '' COMMENT '地址')"
	CreateUSerTree = "CREATE TABLE `hs_user_tree` (" +
		"`TREE_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '用户关系GUID'," +
		"`DEPT_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '部门id'," +
		"`DEPT_CODE` varchar(100) NOT NULL DEFAULT '' COMMENT '部门编码'," +
		"`USER_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '用户id'," +
		"`USER_NAME` varchar(50) NOT NULL DEFAULT '' COMMENT '用户名'," +
		"`POSITION_ID` varchar(50) DEFAULT '' COMMENT '职位id'," +
		"`USER_ORDER_ID` int(11) DEFAULT 10000 COMMENT '用户排序号'," +
		"PRIMARY KEY (`TREE_ID`)," +
		"KEY `IDX_TREE_USER_ID` (`USER_ID`) USING BTREE," +
		"KEY `IDX_TREE_DEPT_ID` (`DEPT_ID`) USING BTREE," +
		"KEY `IDX_USER_ID` (`USER_ID`)," +
		"KEY `IDX_DEPT_ID` (`DEPT_ID`)" +
		") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户关系表';"
	CreateDept = "CREATE TABLE `hs_dept` (" +
		"`DEPT_ROOT_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '部门根节点id'," +
		"`DEPT_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '部门id'," +
		"`DEPT_NAME` varchar(100) NOT NULL DEFAULT '' COMMENT '部门名称'," +
		"`DEPT_DESC` varchar(255) DEFAULT '' COMMENT '部门描述'," +
		"`DEPT_CODE` varchar(100) NOT NULL DEFAULT '' COMMENT '部门编码'," +
		"`DEPT_STYLE` int(11) DEFAULT 0 COMMENT '风格 0:默认，状态优先排序 1:不进行状态排序'," +
		"`DEPT_ORDER_ID` int(11) DEFAULT 10000 COMMENT '排序号'," +
		"`DEPT_PARENT_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '部门父节点'," +
		"`DEPT_FILE_SERVER` varchar(50) DEFAULT '' COMMENT '文件服务名称'," +
		"`DEPT_CREATE_ID` varchar(50) NOT NULL DEFAULT '' COMMENT '创建者id'," +
		"`DEPT_CREATE_NAME` varchar(50) NOT NULL DEFAULT '' COMMENT '创建者用户名'," +
		"`DEPT_CREATE_DATE` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间，微妙级'," +
		"`DEPT_MODIFY_ID` varchar(50) DEFAULT '' COMMENT '修改者ID'," +
		"`DEPT_MODIFY_NAME` varchar(50) DEFAULT '' COMMENT '修改者用户名'," +
		"`DEPT_MODIFY_DATE` bigint(20) DEFAULT 0 COMMENT '最后修改时间，微妙级'," +
		"`DEPT_STATUS` int(2) DEFAULT 0 COMMENT '状态 1:正常 2:禁用 3:删除'," +
		"`SYNC_ID` varchar(50) DEFAULT '' COMMENT '第三方接口同步ID'," +
		"`DEPT_INDEPENDENT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0非独立部门 1独立部门'," +
		"`PARENT_INDEPENDENT_ID` varchar(50) DEFAULT NULL COMMENT '上级独立部门'," +
		"PRIMARY KEY (`DEPT_ID`)" +
		") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='部门表';"
)
